package com.weaver.drools.common.utils;

import cn.hutool.setting.dialect.Props;
/**
 *   读取properties文件内容
 *  @project: Absu_Blog
 *  @author: zhouxinlei
 *  @time：2018年8月9日
 *  @version：ver 1.1
 */
public class PropUtil {
	 private static Props props = new Props("application.properties");

	    public static String getStr(String key) {
	        return props.getStr(key).trim();
	    }

	    public static Integer getInt(String key) {
	        return Integer.parseInt(getStr(key));
	    }

	    public static Boolean getBoolean(String key) {
	        return props.getBool(key);
	    }

	    public static Boolean getBoolean(String key, boolean defaultValue) {
	        return props.getBool(key, defaultValue);
	    }

	    public static void use(String path) {
	        props = new Props(path);
	    }
}
